var User = require('./controllers/user');
var Cat = require('./controllers/cat');
var Course = require('./controllers/course');
var Order = require('./controllers/order');

module.exports = function (app) {
	app.get('/test', function(req, res) {
		res.json({
			foo: "bar"
		})
	});

	app.post('/cat/add', Cat.add);
	app.get('/cat/list', Cat.list);
	app.delete('/cat', Cat.del);

	app.post('/course/new', Course.new);
	app.get('/course/:id/detail', Course.detail);
	app.get('/course/findAll', Course.findAll);
	app.delete('/course/delete/:id', Course.del);

	app.post('/order/add', Order.add);
	app.get('/order/list', Order.list)

	app.get('/user/test', User.test);
	app.post('/user/signup', User.signUp);
	app.post('/user/signin', User.signIn);
	app.get('/user/logout', User.logout);
	app.get('/user/:userId', User.getById);

}
